{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group fl">
<!--            传，小组id，和数据库名称-->
            <a href="{:url('admin/personnels/index',['user'=>$id,'model'=>'member'])}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加</a>
        </div>
        <div class="layui-btn-group fl">
            <a href="#" class="layui-btn"></a>
        </div>
        <div class="layui-btn-group fl">

        </div>
<!--        <div class="fl ml20">-->
<!--            <form action="{:url('admin/member/index')}" class="layui-form" method="get" style="padding:0px;">-->
<!--                <input type="hidden" name="personnel_id" value="{$personnel_id}" autocomplete="off" placeholder="用户" class="layui-input"/>-->
<!--                <div class="layui-form-item">-->
<!--                    <div class="layui-input-inline">-->
<!--                        <input type="text" name="reason" value="{:input('reason')}" autocomplete="off" placeholder="原因" class="layui-input"/>-->
<!--                    </div>-->
<!--                    <div class="fl">-->
<!--                        <button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </form>-->
<!--        </div>-->
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th>id</th>
                <th>姓名</th>
                <th>是否是组长 </th>
                <th>操作</th>
                <th>设为组长 </th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="v" empty="$empty"}
            <tr>
                <td>{$key+1}</td>
                <td>{$v.getPersonnel.name}</td>
                <td>{if $v.leader eq 0}不是{elseif $v.leader eq 1}是{/if}</td>
                <td>
                    <input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('admin/member/teacherstatus', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
                    <a href="{:url('admin/member/edit',['id' => $v.id,'user'=>$id])}">编辑</a>
                    <a href="{:url('admin/member/del',['id' => $v.id,'user'=>$id])}">删除</a>
                </td>
                <td><input type="checkbox" name="leader" lay-skin="switch" lay-filter="*" lay-text="是|否" data-url="{:url('admin/member/teacherstatus', ['id' => $v.id])}" {if $v.leader eq 1}checked="checked"{/if}></td>
            </tr>
            {/foreach}
            </tbody>
        </table>

    </div>
</div>
{/block}
